﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using MsTestUtilities.Utilities;

namespace MsTestUtilities.RowTests
{
    public interface ITestCase<T1, E>
    {
		IExpectation<E> Expectation { get; set; }

		Justification Justification { get; set; }

		T1 G1 { get; } 
	}

	public class TestCase<T1, E> : ITestCase<T1, E>
    {
		TestCaseCollection<T1, E> _builder;
		public T1 G1 { get; private set; } 
		public IExpectation<E> Expectation { get; set; }
		public Justification Justification { get; set; }

		public TestCase(TestCaseCollection<T1, E> builder)
		{
			_builder = builder;
		}

		public void SetPremises(T1 t1)			
		{			
			G1 = t1; 			
		}

		internal AssertionResult IsSatisfiedFor(Func<T1, E> methodUnderTest)
		{
			Func<E> actual = () => methodUnderTest(G1);
			return Expectation.IsSatisfiedFor(actual);
		}
    }

    public interface ITestCase<T1, T2, E>
    {
		IExpectation<E> Expectation { get; set; }

		Justification Justification { get; set; }

		T1 G1 { get; } T2 G2 { get; } 
	}

	public class TestCase<T1, T2, E> : ITestCase<T1, T2, E>
    {
		TestCaseCollection<T1, T2, E> _builder;
		public T1 G1 { get; private set; } public T2 G2 { get; private set; } 
		public IExpectation<E> Expectation { get; set; }
		public Justification Justification { get; set; }

		public TestCase(TestCaseCollection<T1, T2, E> builder)
		{
			_builder = builder;
		}

		public void SetPremises(T1 t1, T2 t2)			
		{			
			G1 = t1; G2 = t2; 			
		}

		internal AssertionResult IsSatisfiedFor(Func<T1, T2, E> methodUnderTest)
		{
			Func<E> actual = () => methodUnderTest(G1, G2);
			return Expectation.IsSatisfiedFor(actual);
		}
    }

    public interface ITestCase<T1, T2, T3, E>
    {
		IExpectation<E> Expectation { get; set; }

		Justification Justification { get; set; }

		T1 G1 { get; } T2 G2 { get; } T3 G3 { get; } 
	}

	public class TestCase<T1, T2, T3, E> : ITestCase<T1, T2, T3, E>
    {
		TestCaseCollection<T1, T2, T3, E> _builder;
		public T1 G1 { get; private set; } public T2 G2 { get; private set; } public T3 G3 { get; private set; } 
		public IExpectation<E> Expectation { get; set; }
		public Justification Justification { get; set; }

		public TestCase(TestCaseCollection<T1, T2, T3, E> builder)
		{
			_builder = builder;
		}

		public void SetPremises(T1 t1, T2 t2, T3 t3)			
		{			
			G1 = t1; G2 = t2; G3 = t3; 			
		}

		internal AssertionResult IsSatisfiedFor(Func<T1, T2, T3, E> methodUnderTest)
		{
			Func<E> actual = () => methodUnderTest(G1, G2, G3);
			return Expectation.IsSatisfiedFor(actual);
		}
    }

    public interface ITestCase<T1, T2, T3, T4, E>
    {
		IExpectation<E> Expectation { get; set; }

		Justification Justification { get; set; }

		T1 G1 { get; } T2 G2 { get; } T3 G3 { get; } T4 G4 { get; } 
	}

	public class TestCase<T1, T2, T3, T4, E> : ITestCase<T1, T2, T3, T4, E>
    {
		TestCaseCollection<T1, T2, T3, T4, E> _builder;
		public T1 G1 { get; private set; } public T2 G2 { get; private set; } public T3 G3 { get; private set; } public T4 G4 { get; private set; } 
		public IExpectation<E> Expectation { get; set; }
		public Justification Justification { get; set; }

		public TestCase(TestCaseCollection<T1, T2, T3, T4, E> builder)
		{
			_builder = builder;
		}

		public void SetPremises(T1 t1, T2 t2, T3 t3, T4 t4)			
		{			
			G1 = t1; G2 = t2; G3 = t3; G4 = t4; 			
		}

		internal AssertionResult IsSatisfiedFor(Func<T1, T2, T3, T4, E> methodUnderTest)
		{
			Func<E> actual = () => methodUnderTest(G1, G2, G3, G4);
			return Expectation.IsSatisfiedFor(actual);
		}
    }

    public interface ITestCase<T1, T2, T3, T4, T5, E>
    {
		IExpectation<E> Expectation { get; set; }

		Justification Justification { get; set; }

		T1 G1 { get; } T2 G2 { get; } T3 G3 { get; } T4 G4 { get; } T5 G5 { get; } 
	}

	public class TestCase<T1, T2, T3, T4, T5, E> : ITestCase<T1, T2, T3, T4, T5, E>
    {
		TestCaseCollection<T1, T2, T3, T4, T5, E> _builder;
		public T1 G1 { get; private set; } public T2 G2 { get; private set; } public T3 G3 { get; private set; } public T4 G4 { get; private set; } public T5 G5 { get; private set; } 
		public IExpectation<E> Expectation { get; set; }
		public Justification Justification { get; set; }

		public TestCase(TestCaseCollection<T1, T2, T3, T4, T5, E> builder)
		{
			_builder = builder;
		}

		public void SetPremises(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5)			
		{			
			G1 = t1; G2 = t2; G3 = t3; G4 = t4; G5 = t5; 			
		}

		internal AssertionResult IsSatisfiedFor(Func<T1, T2, T3, T4, T5, E> methodUnderTest)
		{
			Func<E> actual = () => methodUnderTest(G1, G2, G3, G4, G5);
			return Expectation.IsSatisfiedFor(actual);
		}
    }

    public interface ITestCase<T1, T2, T3, T4, T5, T6, E>
    {
		IExpectation<E> Expectation { get; set; }

		Justification Justification { get; set; }

		T1 G1 { get; } T2 G2 { get; } T3 G3 { get; } T4 G4 { get; } T5 G5 { get; } T6 G6 { get; } 
	}

	public class TestCase<T1, T2, T3, T4, T5, T6, E> : ITestCase<T1, T2, T3, T4, T5, T6, E>
    {
		TestCaseCollection<T1, T2, T3, T4, T5, T6, E> _builder;
		public T1 G1 { get; private set; } public T2 G2 { get; private set; } public T3 G3 { get; private set; } public T4 G4 { get; private set; } public T5 G5 { get; private set; } public T6 G6 { get; private set; } 
		public IExpectation<E> Expectation { get; set; }
		public Justification Justification { get; set; }

		public TestCase(TestCaseCollection<T1, T2, T3, T4, T5, T6, E> builder)
		{
			_builder = builder;
		}

		public void SetPremises(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6)			
		{			
			G1 = t1; G2 = t2; G3 = t3; G4 = t4; G5 = t5; G6 = t6; 			
		}

		internal AssertionResult IsSatisfiedFor(Func<T1, T2, T3, T4, T5, T6, E> methodUnderTest)
		{
			Func<E> actual = () => methodUnderTest(G1, G2, G3, G4, G5, G6);
			return Expectation.IsSatisfiedFor(actual);
		}
    }

}
